continue;
}
#ifdef XEN
-// this works around a problem in the ski bootloader
-{
- extern long running_on_sim;
+ /* this works around a problem in the ski bootloader */
if (running_on_sim && md->type != EFI_CONVENTIONAL_MEMORY)
continue;
-}
#endif
if (pmd == NULL || !efi_wb(pmd) || efi_md_end(pmd) != md->phys_addr) {
contig_low = GRANULEROUNDUP(md->phys_addr);
int xen_ia64_is_running_on_sim(struct domain *unused)
{
- extern unsigned long running_on_sim;
return running_on_sim;
}
static unsigned int __initdata dom0_max_vcpus = 1;
integer_param("dom0_max_vcpus", dom0_max_vcpus);
-extern unsigned long running_on_sim;
-
extern char dom0_command_line[];
/* forward declaration */
panic("Fault in Xen.\n");
}
-unsigned long running_on_sim = 0;
-
/* Also read in hyperprivop.S */
int first_break = 0;
static DEFINE_SPINLOCK(efi_time_services_lock);
-extern unsigned long running_on_sim;
-
struct sal_mc_params {
u64 param_type;
u64 i_or_m;
status = 0;
switch (index) {
case SAL_FREQ_BASE:
- if (!running_on_sim)
+ if (likely(!running_on_sim))
status = ia64_sal_freq_base(in1,&r9,&r10);
else switch (in1) {
case SAL_FREQ_BASE_PLATFORM:
unsigned long flags;
int processor;
- if (running_on_sim)
+ if (unlikely(running_on_sim))
return pal_emulator_static(index);
// pal code must be mapped by a TR when pal is called, however
break;
case SSC_OPEN:
arg1 = vcpu_get_gr(current,33); // access rights
-if (!running_on_sim) { printk("SSC_OPEN, not implemented on hardware. (ignoring...)\n"); arg0 = 0; }
+ if (!running_on_sim) {
+ printk("SSC_OPEN, not implemented on hardware. (ignoring...)\n");
+ arg0 = 0;
+ }
if (arg0) { // metaphysical address
arg0 = translate_domain_mpaddr(arg0, NULL);
retval = ia64_ssc(arg0,arg1,0,0,ssc);
arg1 = vcpu_get_gr(current,33);
arg2 = vcpu_get_gr(current,34);
arg3 = vcpu_get_gr(current,35);
- if (!running_on_sim) { printk("SSC_CONNECT_INTERRUPT, not implemented on hardware. (ignoring...)\n"); break; }
+ if (!running_on_sim) {
+ printk("SSC_CONNECT_INTERRUPT, not implemented on hardware. (ignoring...)\n");
+ break;
+ }
(void)ia64_ssc(arg0,arg1,arg2,arg3,ssc);
break;
case SSC_NETDEV_PROBE:
#include <asm/vcpumask.h>
#include <asm/vmmu.h>
-extern long running_on_sim;
-
DEFINE_PER_CPU (unsigned long, vhpt_paddr);
DEFINE_PER_CPU (unsigned long, vhpt_pend);
#ifdef CONFIG_XEN_IA64_TLBFLUSH_CLOCK
#endif
}
-// called from mem_init... don't think s/w I/O tlb is needed in Xen
-//void swiotlb_init(void) { } ...looks like it IS needed
-
-long
-is_platform_hp_ski(void)
-{
- int i;
- long cpuid[6];
-
- for (i = 0; i < 5; ++i)
- cpuid[i] = ia64_get_cpuid(i);
- if ((cpuid[0] & 0xff) != 'H') return 0;
- if ((cpuid[3] & 0xff) != 0x4) return 0;
- if (((cpuid[3] >> 8) & 0xff) != 0x0) return 0;
- if (((cpuid[3] >> 16) & 0xff) != 0x0) return 0;
- if (((cpuid[3] >> 24) & 0x7) != 0x7) return 0;
- return 1;
-}
-
struct pt_regs *guest_cpu_user_regs(void) { return vcpu_regs(current); }
///////////////////////////////
#include <xen/config.h>
#include <xen/lib.h>
#include <xen/errno.h>
-//#include <xen/spinlock.h>
#include <xen/multiboot.h>
#include <xen/sched.h>
#include <xen/mm.h>
int find_max_pfn (unsigned long, unsigned long, void *);
/* FIXME: which header these declarations should be there ? */
-extern long is_platform_hp_ski(void);
extern void early_setup_arch(char **);
extern void late_setup_arch(char **);
extern void hpsim_serial_init(void);
*/
unsigned int opt_xenheap_megabytes = XENHEAP_DEFAULT_MB;
unsigned long xenheap_size = XENHEAP_DEFAULT_SIZE;
-extern long running_on_sim;
unsigned long xen_pstart;
void *xen_pickle_offset __read_mostly;
startup_cpu_idle_loop();
}
+int running_on_sim;
+
+static int __init
+is_platform_hp_ski(void)
+{
+ int i;
+ long cpuid[6];
+
+ for (i = 0; i < 5; ++i)
+ cpuid[i] = ia64_get_cpuid(i);
+
+ if ((cpuid[0] & 0xff) != 'H')
+ return 0;
+ if ((cpuid[3] & 0xff) != 0x4)
+ return 0;
+ if (((cpuid[3] >> 8) & 0xff) != 0x0)
+ return 0;
+ if (((cpuid[3] >> 16) & 0xff) != 0x0)
+ return 0;
+ if (((cpuid[3] >> 24) & 0x7) != 0x7)
+ return 0;
+
+ return 1;
+}
+
void __init start_kernel(void)
{
char *cmdline;
/* Be sure the struct shared_info size is <= XSI_SIZE. */
BUILD_BUG_ON(sizeof(struct shared_info) > XSI_SIZE);
- running_on_sim = is_platform_hp_ski();
/* Kernel may be relocated by EFI loader */
xen_pstart = ia64_tpa(KERNEL_START);
+ running_on_sim = is_platform_hp_ski();
+
early_setup_arch(&cmdline);
/* We initialise the serial devices very early so we can get debugging. */
#define LOCK_PREFIX
extern unsigned long xenheap_phys_end;
+extern unsigned long total_pages;
extern unsigned long xen_pstart;
extern unsigned long xenheap_size;
+extern int running_on_sim;
+
// from linux/include/linux/mm.h
extern struct page_info *mem_map;